Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@ui5/fs is a file system abstraction library designed for the UI5 framework. It provides utilities for managing and processing file resources in a consistent and efficient manner, which is particularly useful for building and developing UI5 applications.
Resource Management
This feature allows you to create and manage resources. The code sample demonstrates how to create a resource and retrieve its path.
const { resourceFactory } = require('@ui5/fs');
const resource = resourceFactory.createResource({
path: '/path/to/resource',
string: 'content of the resource'
});
console.log(resource.getPath()); // Output: /path/to/resource
Resource Collections
This feature allows you to create collections of resources and perform operations on them. The code sample demonstrates how to create a collection and retrieve a resource by its path.
const { resourceFactory } = require('@ui5/fs');
const resource1 = resourceFactory.createResource({ path: '/path/to/resource1', string: 'content1' });
const resource2 = resourceFactory.createResource({ path: '/path/to/resource2', string: 'content2' });
const collection = resourceFactory.createResourceCollection({
resources: [resource1, resource2]
});
collection.byPath('/path/to/resource1').then(resource => console.log(resource.getString())); // Output: content1
Resource Filtering
This feature allows you to filter resources based on certain criteria. The code sample demonstrates how to filter resources by their path.
const { resourceFactory } = require('@ui5/fs');
const resource1 = resourceFactory.createResource({ path: '/path/to/resource1', string: 'content1' });
const resource2 = resourceFactory.createResource({ path: '/path/to/resource2', string: 'content2' });
const collection = resourceFactory.createResourceCollection({
resources: [resource1, resource2]
});
const filteredResources = collection.filter(resource => resource.getPath().includes('resource1'));
filteredResources.forEach(resource => console.log(resource.getPath())); // Output: /path/to/resource1
fs-extra is a package that extends the native Node.js file system module with additional methods and functionality. It provides similar file management capabilities but is not specifically tailored for UI5 applications. It offers methods for copying, moving, and removing files and directories, among other utilities.
vinyl-fs is a file system utility for working with streams in Node.js. It is part of the Gulp ecosystem and is used for reading, writing, and manipulating files. While it provides similar file management capabilities, it is more focused on stream-based operations and is not specifically designed for UI5 applications.
globby is a package for matching files using glob patterns. It provides utilities for finding files and directories based on patterns, which can be useful for resource management. However, it does not offer the same level of abstraction and specific utilities for UI5 applications as @ui5/fs.
UI5 specific file system abstraction
Part of the UI5 Tooling
⌨️ CLI reference can be found here!
During the build phase, a modified resource is kept in memory for further processing in other build steps.
This ensures performance, as physical read and write access for a high number of resources are kept to a minimum.
The virtual file system offers an abstraction layer from the physical file system. Amongst others, it can combine a bunch of scattered file locations into a well defined, virtualized structure.
Adapers abstract resource access to different resource locations.
The memory adapter represents a virtual file system, which maintains respective resources inside a data structure, whereas the file system adapter has direct access to the physical file sytem.
Maps virtual to physical paths.
Multiple resource readers can be bundled to a collection. There are multiple types of collections which differ in their capability of having read or write access and in the order of how they obtain resources.
The collection has only read access.
The collection takes a list of readers. Readers are accessed in parallel: the reader which returns the resource first is used.
The prioritized collection has only read access.
The collection takes a list of readers. The readers are accessed prioritized in the same order as they are passed to the collection.
The duplex collection has read and write access.
The collection takes a single reader or collection of readers and a writer instance for writing results.
Please check our Contribution Guidelines.
Please follow our Contribution Guidelines on how to report an issue.
See CHANGELOG.md.
This project is licensed under the Apache Software License, Version 2.0 except as noted otherwise in the LICENSE file.
[v1.1.2] - 2019-07-01
573e853
<a name="v1.1.1"></a>
FAQs
UI5 Tooling - File System Abstraction
The npm package @ui5/fs receives a total of 165,531 weekly downloads. As such, @ui5/fs popularity was classified as popular.
We found that @ui5/fs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.